<template>
    <div class="pro-ckwl ">
        <template v-if="model">
        <div class="kitbox pt25 pb30 bgc-fff top-info">
            <div class="photo pl25 pr22"><img src="/static/images/wlgs.png" alt=""></div>
            <div class="flex1">
                <div class="kitbox ">
                    <div class="flex1 fs-13 c-999">
                        <div>承运公司：<span class="c-333">{{model.expName}}</span></div>
                        <div class="pt8">快递单号：<span class="c-333">{{model.number}}</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="bar ptb15 plr15 fs-15 c-888 bgc-fff mt10">物流跟踪</div>
        <div class="pl12 bgc-fff">
            <van-steps
                :steps="steps"
                direction="vertical"
                active-color="#ff6f6f"
            />
        </div>
        </template>
    </div>
</template>

<script>
import orderApi from "@/api/api-order";
import userApi from '@/api/api-user'
export default {
    data () {
        return {
            orderId: '',
            no: '',
            model: "",
            steps: [],
            shopName: "",
            osn: ""
        }
    },
    watch: {
        
    },
    components: {
        
    },
    onLoad(options){
        this.orderId = options.orderId
        this.no = options.no
        this.shopName = options.shopName
        this.osn = options.osn
    },
    mounted () {
        this.GetExpress()
    },
    methods: {
        GetExpress(){
            var vm = this
            orderApi.GetExpress({
                orderId: this.orderId,
                no: this.no
            }).then(res => {
                var steps = []
                res.result.result.list.forEach(v => {
                    steps.push({
                        text: v.status,
                        desc: v.time
                    })
                });
                this.steps = steps
                this.model = res.result.result
                if(!this.model.expName){
                    this.model.expName = this.shopName
                }

                if(!this.model.number){
                    this.model.number = this.osn
                }

                
            }).catch(e=>{
                console.error(e)
            })
        },
    },
}
</script>

<style  lang="scss">
@import "./css/ckwl.scss"
</style>
